package com.qf.hospital.mapper;

import com.qf.hospital.entity.Cashier;
import com.qf.hospital.entity.CashierExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CashierMapper {
    long countByExample(CashierExample example);

    int deleteByExample(CashierExample example);

    int deleteByPrimaryKey(Integer cashierId);

    int insert(Cashier record);

    int insertSelective(Cashier record);

    List<Cashier> selectByExample(CashierExample example);

    Cashier selectByPrimaryKey(Integer cashierId);

    int updateByExampleSelective(@Param("record") Cashier record, @Param("example") CashierExample example);

    int updateByExample(@Param("record") Cashier record, @Param("example") CashierExample example);

    int updateByPrimaryKeySelective(Cashier record);

    int updateByPrimaryKey(Cashier record);

    List<Cashier> findMedicineByReportId(Integer perid);

    int findNoGiveMedicine(@Param("reid") Integer reid, @Param("mename") String mename);

    List<Cashier> findXiangmuByReportId(Integer perid);

    int findNoGiveXiangMu(@Param("reid")Integer reid, @Param("durgname")String durgname);

    @Update("update cashier set drug_num = drug_num + #{durgnum}")
    void updateCountByDrugNum(@Param("durgnum") Integer durgnum);

//    @Update("update cashier set state = 1 where id = #{cashierId}")
//    int deleteByLogical(@Param("cashierId") Integer cashierId);

    //int deleteByPrimaryKey2(Integer cashierId);

//    @Delete("delete from cashier where cashier_id = #{Cid} and drug_name = #{name}")
//    void deleteByIdAndDrugName(@Param("Cid") Integer Cid,@Param("name") String name);
}